import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { UiService } from '../../ui.service';
import { GB } from '../../../environments/environment';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { I18nService } from '../../core/i18n/i18n.service';
import { ActionSheetConfig, SkinType, ActionSheetComponent, ActionSheetService, RatingConfig, PickerService, DatePickerComponent } from 'ngx-weui';
import { MessageService } from './../../core/message.service';
import { InfiniteLoaderComponent, InfiniteLoaderConfig } from 'ngx-weui/infiniteloader';
import { ApiService } from 'src/app/core/api';
import { ActivatedRoute, Router } from '@angular/router';
import { FormBuilder, Validators, FormGroup } from '@angular/forms';
import { StorageService } from 'src/app/core/sotrage/storage.service';

@Component({
  templateUrl: './index.component.html',
  styleUrls: ['./index.component.less'],
  encapsulation: ViewEncapsulation.None,
})
export class WalletListComponent implements OnInit {
  @ViewChild(InfiniteLoaderComponent, { static: true }) il;

  restartBtn = false;
  pageData ={
    pageNo:1,
    pages:1
  }
  list=[]
  constructor(
    private api: ApiService,
    private sto: StorageService,
    private route: ActivatedRoute,
    private router: Router,
    private fb: FormBuilder,
    private srv: PickerService,

  ) {
  }
  onLoadMore(comp: InfiniteLoaderComponent) {
		// console.log('加载了。。。')
		this.restartBtn = false;
		comp.resolveLoading();
		if(this.pageData['pageNo'] < this.pageData['pages']){
			this.pageData['pageNo']++;
			this.getList();
		}
  }
  infiniteLoaderConfig:InfiniteLoaderConfig = {
		height:'92vh'
	};
  ngOnInit() {
    this.getList()
  };

  getList() {
    this.api.post('用户各游戏内钱包余额列表', {pageNo: 1}).then(res => {
			this.list = res['data']['list'];
		});
  }

}
